1 using System;
2 using
UnityEngine;
3 using
UnityEngine.UI;
4
5 namespace
ProceduralToolkit.Examples.UI
6 {
7     
public class ToggleControl : MonoBehaviour
8     {
9         
public Text headerText;
10         
public Toggle toggle;
11
12         
public void Initialize(string header, bool value, Action<bool> onValueChanged, ToggleGroup toggleGroup = null)
13         {
14             name = header;
15             headerText.text = header;
16             toggle.isOn =
value;
17             toggle.onValueChanged.AddListener(newValue => onValueChanged(newValue));
18             toggle.
group = toggleGroup;
19         }
20     }
21 }


Gõ tìm kiếm nhanh...